<!DOCTYPE html>
<html>

<head>
<title>WebGL testing</title>
<meta charset="UTF-8">
<script type="text/javascript" src="../../build/js/Cindy.js"></script>
<script type="text/javascript" src="../../build/js/Cindy3D.js"></script>
<script id="csinit" type="text/x-cindyscript">use("Cindy3D")</script>
<script id="csdraw" type="text/x-cindyscript">
m = 50;
n = 20;
r1 = 1;
r2 = 0.3;
begin3d();
mesh3d(m, n, flatten(apply(1..m, i, apply(1..n, j, (
  a = i/m*360°;
  b = j/n*360°;
  p = [cos(a), sin(a), 0];
  q = cos(b)*[0,0,1] + sin(b)*p;
  r1*p + r2*q
)))), topology->"closeBoth", normaltype->"perVertex");
end3d();
</script>
<script type="text/javascript">
CindyJS({canvasname:"CSCanvas",scripts:"cs*"});
</script>
</head>

<body>
  <canvas id="Cindy3D" style="border: none;" width="632" height="452"></canvas>
  <div id="CSCanvas" style="width:50px; height:50px; border:none"></div>
</body>

</html>
